// ml:run = $bin < input
#include <algorithm>
#include <cstdio>
#include <cstring>

int const maxn = 100007;
int const maxm = 220;
long double f[maxn][maxm];
long double g[maxm];
int a[maxn];
int n;

long double c(int n, int m)
{
    if (n < m) return 0;
    if (n - m < m) return c(n, n - m);
    long double ret = 1;
    for (int j = 1; j <= m; j++) ret /= j;
    for (int j = n - m + 1; j <= n; j++) ret *= j;
    return ret;
}

long double calc(int j, int t, int k, int tot)
{
    return (c(j + t, t) / c(tot, k)) * c(tot - j - t, k - t);
}

int main()
{
    std::scanf("%d", &n);
    long double ans = 0;
    for (int i = 1; i <= n; i++) {
        std::scanf("%d", &a[i]);
        f[i][a[i]] = 1;
        if (!a[i]) ans++;
    }

    int q; std::scanf("%d", &q);
    for (int i = 0; i < q; i++) {
        int u, v, k; std::scanf("%d %d %d", &u, &v, &k);
        ans -= f[u][0];
        int up = std::min(100, a[u]);
        for (int j = 0; j <= up; j++) {
            g[j] = 0;
            for (int t = 0; t <= k; t++)
                g[j] += f[u][j + t] * calc(j, t, k, a[u]);
        }
        for (int j = 0; j <= up; j++)
            f[u][j] = g[j];
        for (int j = 0; j < 10; j++)
            f[u][j + up + 1] = 0;

        /* std::cout << u << ": "; for (int j = 0; j <= 3; j++) std::cout << g[j] << " "; std::cout << "\n"; */

        ans += f[u][0];
        a[u] -= k; a[v] += k;
        double tmp = ans;
        std::printf("%.12f\n", tmp);
    }
}

